<script type="text/javascript">
	function Scorectrl($http, CtrlUtil) {
		var ctrl = this
		var prefix = ':root/components/manager/'
		ctrl.queryUrl = prefix + 'scoreQuery.html'
		ctrl.suspend = prefix + 'scoreSuspend.html'
		ctrl.delayed = prefix + 'scoreDelayed.html'
		ctrl.cert = prefix + 'scoreCert.html'
		ctrl['continue'] = prefix + 'scoreContinue.html'
		this.query = function () {
			ctrl.subCtrl.query()
		}
		this.changePage = function (arg) {
			ctrl.page = ctrl[arg]
		}
		this.getClassInfo = function (term, target) {
			target = target || ctrl
			return $http.post(':root/trainee/getClassInfoList', {
				term: term
			}).success(function (r) {
				target.classInfoList = r
			})
		}
		$http.post(':root/term/queryTerms').success(function (r) {
			ctrl.terms = r.content
			ctrl.termQueryParam = ''
			ctrl.getClassInfo(ctrl.termQueryParam)
		})
		CtrlUtil.loadDepartment(ctrl)
	}

</script>
<div ng-controller="Scorectrl as ctrl" ng-init="ctrl.changePage('queryUrl')">
	<div class="panel panel-cys">
		<div class="panel-heading">
			<h3 class="panel-title">
				<span class="glyphicon glyphicon-search"></span> 信息查询
			</h3>
		</div>
		<div class="panel-body">
			<div class="container-fluid">
				<form class="form-horizontal row">
					<div class="form-group col-md-4 remove-margin-horizontal">
						<div class="col-md-10 col-md-offset-1">
							<select class="form-control" ng-change="ctrl.getClassInfo(m.id)" chosen ng-options="m.id as (m.name+'-第'+m.qs+'期') for m in ctrl.terms" ng-model="ctrl.termQueryParam">
								<option value="">期次</option>
							</select>
						</div>
					</div>
					<div class="form-group col-md-4 remove-margin-horizontal">
						<div class="col-md-10 col-md-offset-1">
							<input placeholder="学号/姓名" ng-model="ctrl.nameQueryParam" type="text" class="form-control">
						</div>
					</div>
					<div class="form-group col-md-4 remove-margin-horizontal">
						<div class="col-md-10 col-md-offset-1">
							<select class="form-control" chosen ng-model="ctrl.khjgQueryParam">
								<option value="">考核结果</option>
								<option>优秀</option>
								<option>良好</option>
								<option>合格</option>
								<option>不通过</option>
							</select>
						</div>
					</div>
					<div class="form-group col-md-4 remove-margin-horizontal">
						<div class="col-md-10 col-md-offset-1">
							<select class="form-control" chosen ng-change="ctrl.changeDepartment()" ng-options="m.id as m.name for m in ctrl.departments" ng-model="ctrl.departmentQueryParam">
								<option value="">院系</option>
							</select>

						</div>
					</div>
					<div class="form-group col-md-4 remove-margin-horizontal">
						<div class="col-md-10 col-md-offset-1">
							<select class="form-control" chosen ng-options="m.id as m.bjName for m in ctrl.classInfoList" ng-model="ctrl.clazzQueryParam">
								<option value="">班级</option>
							</select>
						</div>
					</div>
				</form>
			</div>
			<div class="row pull-right">
				<div class="col-md-12">
					<button ng-click="ctrl.query()" type="submit" class="btn btn-cys btn-sm">
						<span class="glyphicon glyphicon-search"></span>
						查询
					</button>
					<button ng-click="ctrl.reset()" type="reset" class="btn btn-default btn-sm">
						<span class="glyphicon glyphicon-repeat"></span>
						重置
					</button>
				</div>
			</div>
		</div>
	</div>
	<!-- Search area END -->
	<ul class="nav nav-tabs" role="tablist" style="margin-bottom: 10px;">
		<li ng-click="ctrl.changePage('queryUrl')" role="presentation" ng-class="{active:ctrl.page==ctrl.queryUrl}">
			<a href="javascript:;" aria-controls="home" role="tab" data-toggle="tab"> 成绩信息 </a>
		</li>
		<!-- <li ng-click="ctrl.changePage('delayed')" role="presentation" ng-class="{active:ctrl.page==ctrl.delayed}">
			<a href="javascript:;" aria-controls="home" role="tab" data-toggle="tab"> 往期缓考 </a>
		</li> -->
		<li ng-click="ctrl.changePage('suspend')" role="presentation" ng-class="{active:ctrl.page==ctrl.suspend}">
			<a href="javascript:;" aria-controls="home" role="tab" data-toggle="tab"> 保留成绩申请 </a>
		</li>
		<li ng-click="ctrl.changePage('continue')" role="presentation" ng-class="{active:ctrl.page==ctrl.continue}">
			<a href="javascript:;" aria-controls="home" role="tab" data-toggle="tab"> 续修课程申请 </a>
		</li>
		<!-- <li ng-click="ctrl.changePage('cert')" role="presentation" ng-class="{active:ctrl.page==ctrl.cert}">
			<a href="javascript:;" aria-controls="home" role="tab" data-toggle="tab"> 结业证书补办申请 </a>
		</li> -->
	</ul>
	<!-- operation area -->
	<!-- data grid area END -->

	<div class="tab-content" ng-include="ctrl.page">
		<!-- 学员管理 -->
	</div>
</div>